#include<iostream>

using namespace std;
const static float PI = 3.14;

class Shape {
    private:
        float x;
        double y;
};

class Point {
    private:
        float x,y;
        float z;
    public:
        Point(float a,float b):x(a),y(b) {}
        virtual double area() {return 0;}
        void display() {
            cout << "Point display" << endl;
        }
};

class Circle : public Point {
    private:
        float radius;
    public:
        Circle(float a,float b,float r):Point(a,b),radius(r) {

        }
        double area() {
            return PI * radius * radius;
        }
        virtual void display() {
            cout << "Circle display"<< endl;
        }

};

void display(void) {
    cout << "invoke display" << endl;
}


int main() {
    cout << "sizeof float = " << sizeof(float) << endl;
    cout << "sizeof double = " << sizeof(double) << endl;
    cout << "sizeof Shape = " << sizeof(Shape) << endl;
    cout << "sizeof Point = " << sizeof(Point) << endl;
    cout << "sizeof int* = " << sizeof(int*) << endl;
    void (*p) ();
    cout << "sizeof p = " << sizeof(p) << endl;
    p = display;
    (*p)();

    cout << "sizeof Circle = " << sizeof(Circle) << endl;

    Circle c = Circle(1,2,3);
    Point point = c;
    Point * pc = &c;
    cout << "area = " << point.area() << endl;
    cout << "pointer area = " << pc->area() << endl;
    point.display();
    pc -> display();
    Point& rc = c;
    cout << "reference area = " << rc.area() << endl;
    rc.display();

    return 0;
}
